#ifndef OBSERVER_H
#define OBSERVER_H
#include <list>

// The observer design pattern
namespace design
{

	class Observable;

	class Observer
	{
		public:
		   virtual void Update(Observable *, int aspect) = 0;
	};
	
	class Observable
	{
		public:
			void Attach(Observer *);
			void Detach(Observer *);
			void Notify(int aspect);
		private:
			typedef std::list<Observer *> ObserverPtrList;
			std::list<Observer *> _observers;
	};
}

#endif
